const mongoose = require('mongoose');
//创建结构对象
const MovieSchema = new mongoose.Schema({
  name: {
    type: String,
    required: true
  },
  director: {
    type: String,
    required: true
  },
  actors: {
    type: Array
  },
  rate: {
    type: Number,
    default: 0
  },
  pub_time: {
    type: Date
  }
})

//创建模型对象
const MovieModel = mongoose.model('movie', MovieSchema);

module.exports = MovieModel;